Skip to content

feat: send identity user_id with subscription checks - #62

Merged
sgardoll merged 1 commit into
mainfrom
feat/send-user-id-with-subscription-check
Aug 23, 2026
Merged

feat: send identity user_id with subscription checks#62
sgardoll merged 1 commit into
mainfrom
feat/send-user-id-with-subscription-check

Conversation

@sgardoll

@sgardoll sgardoll commented Aug 23, 2026

Copy link
Copy Markdown
Owner

Problem

Pairs with the buildship revenue-attribution change. fetchSubscription sent only the session JWT + email, so the server had no way to link a signed-in visitor to their anonymous identities document — the missing half of why the identities collection could never record revenue.

Fix

One line: the /stripe/get-subscription request body now also carries user_id: identityState.userId. The server derives everything sensitive (email, tier) from the verified JWT; this id only selects WHICH identity document gets stamped with billing state.

  • Absent/falsy userId serializes away and the server skips the stamp — guests and failed identity resolution are unaffected.

Verification

  • Full suite 234/234 (npm test)
  • No other call sites changed

Greptile Summary

Adds the resolved identity user ID to authenticated subscription-check requests so the service can associate billing state with the corresponding identity document.

  • Extends the /stripe/get-subscription JSON body with identityState.userId.
  • Leaves guest and unresolved-identity requests unchanged because absent values are omitted by serialization.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
app.js Extends subscription-check requests with the currently resolved identity user ID; no eligible follow-up issue was identified.

Reviews (2): Last reviewed commit: "feat: send identity user_id with subscri..." | Re-trigger Greptile

Comment thread src/flutterFlowCodeSanitizer.js Outdated
Comment on lines +42 to +44
const fenceIndexes = [];
for (let index = 0; index < lines.length; index++) {
if (FENCE_LINE_PATTERN.test(lines[index])) fenceIndexes.push(index);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Fence parsing corrupts valid Dart

When valid Dart contains line-leading triple backticks inside a multiline string or block comment, sanitizeGeneratedDart treats those lines as Markdown fence boundaries and discards the surrounding source, causing the single-artifact deployment to fail validation or push code that differs from the reviewed artifact.

Knowledge Base Used: FlutterFlow artifact pipeline

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/flutterFlowCodeSanitizer.js
Line: 42-44

Comment:
**Fence parsing corrupts valid Dart**

When valid Dart contains line-leading triple backticks inside a multiline string or block comment, `sanitizeGeneratedDart` treats those lines as Markdown fence boundaries and discards the surrounding source, causing the single-artifact deployment to fail validation or push code that differs from the reviewed artifact.

**Knowledge Base Used:** [FlutterFlow artifact pipeline](https://app.greptile.com/connect-i-o/-/custom-context/knowledge-base/sgardoll/customcodeconnectforflutterflow/-/docs/flutterflow-artifact-pipeline.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code Fix in Codex

Pairs with buildship feat/identities-revenue-attribution: the verified
session JWT plus this user_id let stripe-get-subscription stamp billing
state (email/tier/revenue) onto the caller's identities document.
@sgardoll
sgardoll force-pushed the feat/send-user-id-with-subscription-check branch from cb0b5ea to 1c2c9cd Compare August 23, 2026 00:54
@sgardoll
sgardoll merged commit bb28da3 into main Aug 23, 2026
6 checks passed
@sgardoll
sgardoll deleted the feat/send-user-id-with-subscription-check branch August 23, 2026 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant